package com.xpgk.mvc.budgetMonth;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseModel;


/**
 * 预算记录表
 */
@SuppressWarnings("unused")
@Table(tableName = BudgetMonthDetail.table_name)
public class BudgetMonthDetail  extends  BaseModel<BudgetMonthDetail>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2729134685118302194L;

	private static final Log log = Log.getLog(BudgetMonthDetail.class);

	public static final BudgetMonthDetail dao = new BudgetMonthDetail().dao();

	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	/**
	 * 表名称
	 */
	public static final String table_name = "sb_shop_month_budget_detail";
	/**
	 * 字段描述：主键 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";
	/**
	 * 字段描述：月度预算Ids  字段类型：character varying 长度：32
	 */
	public static final String column_budgetMonthIds = "budgetMonthIds";
	/**
	 * 字段描述：产品ids 字段类型：character varying 长度：32
	 */
	public static final String column_productIds = "productIds";
	/**
	 * 字段描述：新顾客-计划数量 字段类型：character varying 长度：32
	 */
	public static final String column_newCusPlanNum = "newCusPlanNum";
	/**
	 * 字段描述：新顾客-计划金额 字段类型：character varying 长度：32
	 */
	public static final String column_newCusPlanPrice = "newCusPlanPrice";
	/**
	 * 字段描述：新顾客-计划疗程数量字段类型：character varying 长度：32
	 */
	public static final String column_newCusLcNum = "newCusLcNum";
	/**
	 * 字段描述：老顾客-计划数量 字段类型：character varying 长度：32
	 */
	public static final String column_oldCusPlanNum = "oldCusPlanNum";
	/**
	 * 字段描述：老顾客-计划金额 字段类型：character varying 长度：32
	 */
	public static final String column_oldCusPlanPrice = "oldCusPlanPrice";
	/**
	 * 字段描述：更新时间 字段类型：character varying 长度：32
	 */
	public static final String column_gxsj = "gxsj";
	
	
	
	
	/**
	 * 关联查询，获取月度
	 * 
	 * @return
	 */
	public BudgetMonth getBudgetMonth() {
		
		return BudgetMonth.dao.findById(this.getStr(column_budgetMonthIds));
	}
	/**
	 * 关联查询，获取月度
	 * 
	 * @return
	 */
	public BudgetMonthDetail getBudgetMonthDetail(String budgetMonthIds,String productIds) {
		
		String  sql="SELECT  *  from  sb_budgetmonth_detail  WHERE  budgetMonthIds=? and  productIds=?";
		return BudgetMonthDetail.dao.findFirst(sql,budgetMonthIds,productIds);
	}
	
	
}
